package com.wcarmon.life.command{

    import com.adobe.cairngorm.commands.ICommand
    import com.adobe.cairngorm.control.CairngormEvent;
	import mx.controls.Alert;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.IResponder;
	import com.wcarmon.life.model.LifeModelLocator;
	import com.wcarmon.life.event.*;
	import com.wcarmon.life.business.*;
	import com.wcarmon.life.vo.*;
	import mx.utils.ObjectUtil;
	
	
	public class ShowDoCommand implements ICommand, IResponder {
		include "../../includes/loggerSnippet.as";
	
		public function execute( event : CairngormEvent ) : void {
			var e : ShowDoEvent = ShowDoEvent( event );
			LifeModelLocator.getInstance().currentDoContext = e.context; 
			( new GetNextActionsDelegate(this) ).getNextActionsForDo();
		}
	
	 	public function result( event : Object ) : void {
			var e : ResultEvent = ResultEvent(event);
			var model : LifeModelLocator = LifeModelLocator.getInstance();
			
			model.currentDoScreen = DoScreenVO.makeVO( e.result );
			model.gotoScreen( LifeModelLocator.SCREEN_DO );
		}
	
		public function fault( event : Object ) : void {
			include "includes/FaultSnippet.as";
		}
	}
}